<?php
/**
 * Created by PhpStorm.
 * User: ZZF
 * Date: 2017/3/16
 * Time: 11:36
 */

namespace app\admin\model;
use think\Model;
use think\Verify;
class TypeItemModel extends Model{
	protected $validate = [
         'rule' => [
			 'type_id' => "require|unique:type_item,type_id^goods_id",
			 'goods_id' => "require|unique:type_item,type_id^goods_id"
		 ],
         'msg'  => [
			 'type_id.require' => "分类商品必须填",
			 'type_id.unique' => "分类商品已存在",
			 'goods_id.require' => "分类商品必须填",
			 'goods_id.unique' => "分类商品已存在"
		 ]
    ];

    public function check_verify(){
        $verify = new Verify();
        return $verify->check(input('verify'));
    }
}
